package com.zhangwei.service.impl;


import com.zhangwei.mapper.CityInfoMapper;
import com.zhangwei.pojo.CityInfo;
import com.zhangwei.service.CityInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class CityInfoServiceImpl implements CityInfoService {

    @Autowired
    CityInfoMapper cityInfoMapper;

    @Override
    public List<CityInfo> selectAll() {

        List<CityInfo> list= cityInfoMapper.selectAll();
        return list;
    }

    @Override
    public CityInfo selectById(int id) {
        return cityInfoMapper.selectById(id);
    }

    @Override
    public int insertOne(CityInfo cityInfo) {
        log.info("执行增加操作");
        return cityInfoMapper.insertOne(cityInfo);
    }

    @Override
    public int delById(int id) {

        return cityInfoMapper.delById(id);
    }

    @Override
    public int updateOne(CityInfo cityInfo) {

//        System.out.println("access  update  1111111111");
        System.out.println(cityInfo.getId()+cityInfo.getCityName());
        return cityInfoMapper.updateOne(cityInfo);
    }
}
